package com.wsmall.fenxiao.order.web;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "goods", fallback = GoodsServiceClientFallback.class)
public interface GoodsServiceClient {

  @RequestMapping("/goods")
  String getGoodsNames(@RequestParam("goods") String goods);


}

@Component
class GoodsServiceClientFallback implements GoodsServiceClient {

  @Override
  public String getGoodsNames(String goods) {
    return "goods service is fail";
  }
}
